from server.module_chat.chat.core.agent.tool.api.chat_api import ChatApi
from server.module_chat.chat.core.agent.tool.api.chat_result import ChatResult
from server.module_chat.chat.core.agent.tool.tool import ToolApi


class ActChatApi(ChatApi):
    def __init__(self, tool_api: ToolApi, **kwargs):
        super().__init__(tool_api, **kwargs)

    def build_data(self, **kwargs) -> dict:
        return {
            "query": self.query,
            "conversation_id": self.conversation_id,

        }

    def build_result(self, chunk: bytes) -> ChatResult:
        return ChatResult(**{
            "conversation_id": "",
            "message_id": "",
            "text": chunk,
        })